.TH "C:/Users/Matt/Documents/School/Robotics/zebulon/v2/vision/ext/SIFT/xform.h" 3 "13 Oct 2009" "Version 2" "zebulon" \" -*- nroff -*-
.ad l
.nh
.SH NAME
C:/Users/Matt/Documents/School/Robotics/zebulon/v2/vision/ext/SIFT/xform.h \- 
.SH SYNOPSIS
.br
.PP
\fC#include <cxcore.h>\fP
.br

.SS "Classes"

.in +1c
.ti -1c
.RI "struct \fBransac_data\fP"
.br
.in -1c
.SS "Defines"

.in +1c
.ti -1c
.RI "#define \fBRANSAC_ERR_TOL\fP   3"
.br
.ti -1c
.RI "#define \fBRANSAC_INLIER_FRAC_EST\fP   0.25"
.br
.ti -1c
.RI "#define \fBRANSAC_PROB_BAD_SUPP\fP   0.10"
.br
.ti -1c
.RI "#define \fBfeat_ransac_data\fP(feat)   ( (struct \fBransac_data\fP*) (feat)->feature_data )"
.br
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef CvMat *(* \fBransac_xform_fn\fP )(CvPoint2D64f *pts, CvPoint2D64f *mpts, int n)"
.br
.ti -1c
.RI "typedef double(* \fBransac_err_fn\fP )(CvPoint2D64f pt, CvPoint2D64f mpt, CvMat *M)"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "CvMat * \fBransac_xform\fP (struct \fBfeature\fP *features, int n, int mtype, \fBransac_xform_fn\fP xform_fn, int m, double p_badxform, \fBransac_err_fn\fP err_fn, double err_tol, struct \fBfeature\fP ***inliers, int *n_in)"
.br
.ti -1c
.RI "CvMat * \fBlsq_homog\fP (CvPoint2D64f *pts, CvPoint2D64f *mpts, int n)"
.br
.ti -1c
.RI "double \fBhomog_xfer_err\fP (CvPoint2D64f pt, CvPoint2D64f mpt, CvMat *H)"
.br
.ti -1c
.RI "CvPoint2D64f \fBpersp_xform_pt\fP (CvPoint2D64f pt, CvMat *T)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Functions for computing transforms from image \fBfeature\fP correspondences
.PP
Copyright (C) 2006 Rob Hess <hess@eecs.oregonstate.edu> 
.PP
\fBVersion:\fP
.RS 4
1.1.1-20070913 
.RE
.PP

.SH "Define Documentation"
.PP 
.SS "#define RANSAC_INLIER_FRAC_EST   0.25"pessimistic estimate of fraction of inlers for RANSAC 
.SS "#define RANSAC_PROB_BAD_SUPP   0.10"estimate of the probability that a correspondence supports a bad model 
.SH "Typedef Documentation"
.PP 
.SS "typedef double(* \fBransac_err_fn\fP)(CvPoint2D64f pt, CvPoint2D64f mpt, CvMat *M)"Prototype for error functions passed to \fBransac_xform()\fP. For a given point, its correspondence, and a transform, functions of this type should compute a measure of error between the correspondence and the point after the point has been transformed by the transform.
.PP
\fBParameters:\fP
.RS 4
\fIpt\fP a point 
.br
\fImpt\fP \fIpt's\fP correspondence 
.br
\fIT\fP a transform
.RE
.PP
\fBReturns:\fP
.RS 4
Should return a measure of error between \fImpt\fP and \fIpt\fP after \fIpt\fP has been transformed by the transform \fIT\fP. 
.RE
.PP

.SS "typedef CvMat*(* \fBransac_xform_fn\fP)(CvPoint2D64f *pts, CvPoint2D64f *mpts, int n)"Prototype for transformation functions passed to \fBransac_xform()\fP. Functions of this type should compute a transformation matrix given a set of point correspondences.
.PP
\fBParameters:\fP
.RS 4
\fIpts\fP array of points 
.br
\fImpts\fP array of corresponding points; each \fIpts\fP[\fIi\fP], \fIi=0\fP..\fIn-1\fP, corresponds to \fImpts\fP[\fIi\fP] 
.br
\fIn\fP number of points in both \fIpts\fP and \fImpts\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
Should return a transformation matrix that transforms each point in \fIpts\fP to the corresponding point in \fImpts\fP or NULL on failure. 
.RE
.PP

.SH "Function Documentation"
.PP 
.SS "double homog_xfer_err (CvPoint2D64f pt, CvPoint2D64f mpt, CvMat * H)"Calculates the transfer error between a point and its correspondence for a given homography, i.e. for a point $x$, it's correspondence $x'$, and homography $H$, computes $d(x', Hx)^2$. Intended for use as a ransac_err_fn.
.PP
\fBParameters:\fP
.RS 4
\fIpt\fP a point 
.br
\fImpt\fP \fIpt's\fP correspondence 
.br
\fIH\fP a homography matrix
.RE
.PP
\fBReturns:\fP
.RS 4
Returns the transfer error between \fIpt\fP and \fImpt\fP given \fIH\fP 
.RE
.PP

.SS "CvMat* lsq_homog (CvPoint2D64f * pts, CvPoint2D64f * mpts, int n)"Calculates a least-squares planar homography from point correspondeces. Intended for use as a ransac_xform_fn.
.PP
\fBParameters:\fP
.RS 4
\fIpts\fP array of points 
.br
\fImpts\fP array of corresponding points; each \fIpts\fP[\fIi\fP], \fIi=0\fP..\fIn-1\fP, corresponds to \fImpts\fP[\fIi\fP] 
.br
\fIn\fP number of points in both \fIpts\fP and \fImpts\fP; must be at least 4
.RE
.PP
\fBReturns:\fP
.RS 4
Returns the $3 \times 3$ least-squares planar homography matrix that transforms points in \fIpts\fP to their corresponding points in \fImpts\fP or NULL if fewer than 4 correspondences were provided 
.RE
.PP

.SS "CvPoint2D64f persp_xform_pt (CvPoint2D64f pt, CvMat * T)"Performs a perspective transformation on a single point. That is, for a point $(x, y)$ and a $3 \times 3$ matrix $T$ this function returns the point $(u, v)$, where
.br
.PP
$[x' \ y' \ w']^T = T \times [x \ y \ 1]^T$,
.br
.PP
and
.br
.PP
$(u, v) = (x'/w', y'/w')$.
.PP
Note that affine transforms are a subset of perspective transforms.
.PP
\fBParameters:\fP
.RS 4
\fIpt\fP a 2D point 
.br
\fIT\fP a perspective transformation matrix
.RE
.PP
\fBReturns:\fP
.RS 4
Returns the point $(u, v)$ as above. 
.RE
.PP

.SS "CvMat* ransac_xform (struct \fBfeature\fP * features, int n, int mtype, \fBransac_xform_fn\fP xform_fn, int m, double p_badxform, \fBransac_err_fn\fP err_fn, double err_tol, struct \fBfeature\fP *** inliers, int * n_in)"Calculates a best-fit image transform from image \fBfeature\fP correspondences using RANSAC.
.PP
For more information refer to:
.PP
Fischler, M. A. and Bolles, R. C. Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography. \fICommunications of the ACM, 24\fP, 6 (1981), pp. 381--395.
.PP
\fBParameters:\fP
.RS 4
\fIfeatures\fP an array of features; only features with a non-NULL match of type \fImtype\fP are used in homography computation 
.br
\fIn\fP number of features in \fIfeat\fP 
.br
\fImtype\fP determines which of each feature's match fields to use for transform computation; should be one of FEATURE_FWD_MATCH, FEATURE_BCK_MATCH, or FEATURE_MDL_MATCH; if this is FEATURE_MDL_MATCH, correspondences are assumed to be between a feature's img_pt field and its match's mdl_pt field, otherwise correspondences are assumed to be between the the feature's img_pt field and its match's img_pt field 
.br
\fIxform_fn\fP pointer to the function used to compute the desired transformation from \fBfeature\fP correspondences 
.br
\fIm\fP minimum number of correspondences necessary to instantiate the transform computed by \fIxform_fn\fP 
.br
\fIp_badxform\fP desired probability that the final transformation returned by RANSAC is corrupted by outliers (i.e. the probability that no samples of all inliers were drawn) 
.br
\fIerr_fn\fP pointer to the function used to compute a measure of error between putative correspondences for a given transform 
.br
\fIerr_tol\fP correspondences within this distance of each other are considered as inliers for a given transform 
.br
\fIinliers\fP if not NULL, output as an array of pointers to the final set of inliers 
.br
\fIn_in\fP if not NULL, output as the final number of inliers
.RE
.PP
\fBReturns:\fP
.RS 4
Returns a transformation matrix computed using RANSAC or NULL on error or if an acceptable transform could not be computed. 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for zebulon from the source code.
